<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="css/style.css" rel="stylesheet" type="text/css" />
        <title>Login and Register</title>
        <script type="text/javascript" charset="utf-8">
            // <![CDATA[
            function fbs_click() {u=location.href;t=document.title;
                window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
                return false;}
            // ]]>
        </script>
    </head>

    <body>
        <div id="container">
            <jsp:include page="includes/header.html" />
            <div class="main">
                <div class="services">
                    <div class="service_bg">
                        <h3>Our services</h3>
                        <p>Welcome to Cult Cinema! This is the welcome page of our cinema. You can log in, register, search movie and purchase on this website. Have fun!</p>
                    </div>
                    <div class="clr"></div>
                    <div class="service_bg">
                        <h3>About the authors</h3>
                        <p><img src="images/user_pic.jpg" width="63" height="63" hspace="5" align="left" alt="picture" /><a href="#"><strong>ZHANG Niantong</strong></a><br />
                            Department of Computer Science, City University of Hong Kong</p>
                        <p><img src="images/user_pic.jpg" width="63" height="63" hspace="5" align="left" alt="picture" /><a href="#"><strong>ZHANG Hao</strong></a><br />
                            Department of Computer Science, City University of Hong Kong</p>
                    </div>
                    <div class="service_bg">
                        <h3>Contect us!</h3>
                        <p>Tat Chee Avenue, Kowloon, Hong Kong SAR  </p>
                        <p><span class="px22">+ 852 1111 1111</span></p>
                    </div>
                </div>
                <div class="global_main">
                    <div class="page_title_text">
                        <h1>Purchase Confirm</h1>
                        <div class="clr"></div>
                        <div class="block_text">
                            <div class="Mt">
                                <form action="officerPurchase.do" method="post" class="movieform">
                                    <input name="action" type="hidden" value="payment" />
                                    <div class="Mt">
                                        <h4>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Payment Method:</h4>
                                        <h4>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(According to the requirement of this assignment, the payment using credit card is not available)</h4>
                                        <h4>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(If you would like to use credit card, just click "Confirm Payment")</h4>
                                        <div>
                                            <label>Cash</label><input type="radio" checked="checked" name="paymentMethod" value="cash" />
                                        </div>
                                        <div>
                                            <label>Loyalty Point</label>
                                            <%
                                                        Integer nLoyaltyPoint = (Integer) session.getAttribute("loyaltyPoint");
                                                        if (nLoyaltyPoint == null) {
                                                            nLoyaltyPoint = 0;
                                                        }
                                                        Integer nTotalPayment = (Integer) session.getAttribute("totalPayment");
                                                        if (nTotalPayment <= nLoyaltyPoint) {
                                            %>
                                            <input type="radio" name="paymentMethod" value="loyaltyPoint" />
                                            <%                } else {
                                            %>
                                            <input type="radio" name="paymentMethod" value="loyaltyPoint" disabled="disabled"/>
                                            <%                    }
                                            %>
                                        </div>
                                        <div>
                                            <label>Total Payment:</label>
                                            <input type="text" value=<%= session.getAttribute("totalPayment")%> readonly="readonly" style="background:gray" />
                                        </div>
                                        <div>
                                            <label>Available Loyalty Points: </label>
                                            <input type="text" value=<%=session.getAttribute("loyaltyPoint")%> readonly="readonly" style="background:gray" />
                                        </div>

                                        <div class="button">
                                            <input type="submit" value="Confirm Payment" />
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="clr"></div>
                        </div>
                    </div>
                    <div class="clr"></div>
                </div>
                <div class="clr"></div>
            </div>
            <jsp:include page="includes/footer.html" />
        </div>
    </body>
</html>